/*
Navicat SQL Server Data Transfer

Source Server         : MSSQLLocalDB
Source Server Version : 130000
Source Host           : (localdb)\MSSQLLocalDB:1433
Source Database       : User
Source Schema         : dbo

Target Server Type    : SQL Server
Target Server Version : 130000
File Encoding         : 65001

Date: 2017-06-07 15:37:16
*/


-- ----------------------------
-- Table structure for TAction
-- ----------------------------
DROP TABLE [dbo].[TAction]
GO
CREATE TABLE [dbo].[TAction] (
[ActionID] int NOT NULL IDENTITY(1,1) ,
[ActionName] nvarchar(255) NOT NULL ,
[Description] nvarchar(255) NULL ,
[CreateTime] datetime NULL ,
[ActionType] int NULL ,
[ParentID] int NULL ,
[UpdateTime] datetime NULL 
)


GO
DBCC CHECKIDENT(N'[dbo].[TAction]', RESEED, 1012)
GO

-- ----------------------------
-- Table structure for TArea
-- ----------------------------
DROP TABLE [dbo].[TArea]
GO
CREATE TABLE [dbo].[TArea] (
[ID] int NOT NULL IDENTITY(1,1) ,
[CityCode] int NOT NULL ,
[AreaName] nvarchar(255) NULL ,
[ParentID] int NULL ,
[Levels] int NULL 
)


GO
DBCC CHECKIDENT(N'[dbo].[TArea]', RESEED, 34)
GO

-- ----------------------------
-- Table structure for TMenu
-- ----------------------------
DROP TABLE [dbo].[TMenu]
GO
CREATE TABLE [dbo].[TMenu] (
[MenuID] int NOT NULL IDENTITY(1,1) ,
[Name] nvarchar(255) NOT NULL ,
[Description] nvarchar(255) NULL ,
[CreateTime] datetime NULL ,
[ParentID] int NOT NULL DEFAULT ((0)) ,
[MenuType] int NULL ,
[Urls] nvarchar(255) NULL ,
[UpdateTime] datetime NULL 
)


GO
DBCC CHECKIDENT(N'[dbo].[TMenu]', RESEED, 7)
GO

-- ----------------------------
-- Table structure for TProduct
-- ----------------------------
DROP TABLE [dbo].[TProduct]
GO
CREATE TABLE [dbo].[TProduct] (
[ProductID] int NOT NULL IDENTITY(1,1) ,
[ProductName] nvarchar(MAX) NULL ,
[UnitCost] int NULL ,
[Status] int NULL ,
[Prices] money NULL ,
[Details] nvarchar(MAX) NULL ,
[Types] int NULL ,
[Startdate] datetime NULL ,
[Enddate] datetime NULL ,
[CreateTime] datetime NULL ,
[UpdateTime] datetime NULL 
)


GO
DBCC CHECKIDENT(N'[dbo].[TProduct]', RESEED, 6)
GO

-- ----------------------------
-- Table structure for TUser
-- ----------------------------
DROP TABLE [dbo].[TUser]
GO
CREATE TABLE [dbo].[TUser] (
[UserID] int NOT NULL IDENTITY(1,1) ,
[UserName] nvarchar(255) NOT NULL ,
[CreateTime] datetime NULL ,
[UpdateTime] datetime NULL 
)


GO

-- ----------------------------
-- Table structure for TUserAction
-- ----------------------------
DROP TABLE [dbo].[TUserAction]
GO
CREATE TABLE [dbo].[TUserAction] (
[UserID] int NOT NULL ,
[ActionID] int NOT NULL ,
[HasPermission] int NOT NULL DEFAULT ((0)) ,
[CreateTime] datetime NULL ,
[UserActionID] int NOT NULL IDENTITY(1,1) ,
[ActionName] nvarchar(255) NOT NULL ,
[ParentID] int NOT NULL ,
[UpdateTime] datetime NULL 
)


GO
DBCC CHECKIDENT(N'[dbo].[TUserAction]', RESEED, 7)
GO

-- ----------------------------
-- Table structure for TUserInfo
-- ----------------------------
DROP TABLE [dbo].[TUserInfo]
GO
CREATE TABLE [dbo].[TUserInfo] (
[UserID] int NOT NULL IDENTITY(1,1) ,
[UserName] nvarchar(255) NOT NULL ,
[PassWords] nvarchar(255) NOT NULL ,
[Phones] nvarchar(255) NOT NULL ,
[Sexs] nvarchar(255) NOT NULL ,
[AddressInfo] nvarchar(255) NOT NULL ,
[UserEmail] nvarchar(255) NOT NULL ,
[CreateTime] datetime NULL ,
[UpdateTime] datetime NULL ,
[UserType] int NULL ,
[IsLock] int NULL ,
[IsDelete] int NULL ,
[Ages] int NULL ,
[AddressID] int NULL 
)


GO
DBCC CHECKIDENT(N'[dbo].[TUserInfo]', RESEED, 3)
GO

-- ----------------------------
-- Table structure for TUserMenu
-- ----------------------------
DROP TABLE [dbo].[TUserMenu]
GO
CREATE TABLE [dbo].[TUserMenu] (
[UserID] int NOT NULL ,
[MenuID] int NOT NULL ,
[HasPermission] int NOT NULL DEFAULT ((0)) ,
[CreateTime] datetime NULL ,
[UserMenuID] int NOT NULL IDENTITY(1,1) ,
[MenuName] nvarchar(255) NOT NULL ,
[ParentID] int NOT NULL ,
[UpdateTime] datetime NULL 
)


GO
DBCC CHECKIDENT(N'[dbo].[TUserMenu]', RESEED, 4)
GO

-- ----------------------------
-- Indexes structure for table TAction
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table TAction
-- ----------------------------
ALTER TABLE [dbo].[TAction] ADD PRIMARY KEY ([ActionID])
GO

-- ----------------------------
-- Indexes structure for table TArea
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table TArea
-- ----------------------------
ALTER TABLE [dbo].[TArea] ADD PRIMARY KEY ([ID])
GO

-- ----------------------------
-- Indexes structure for table TMenu
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table TMenu
-- ----------------------------
ALTER TABLE [dbo].[TMenu] ADD PRIMARY KEY ([MenuID])
GO

-- ----------------------------
-- Indexes structure for table TProduct
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table TProduct
-- ----------------------------
ALTER TABLE [dbo].[TProduct] ADD PRIMARY KEY ([ProductID])
GO

-- ----------------------------
-- Indexes structure for table TUser
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table TUser
-- ----------------------------
ALTER TABLE [dbo].[TUser] ADD PRIMARY KEY ([UserID])
GO

-- ----------------------------
-- Indexes structure for table TUserAction
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table TUserAction
-- ----------------------------
ALTER TABLE [dbo].[TUserAction] ADD PRIMARY KEY ([UserActionID])
GO

-- ----------------------------
-- Indexes structure for table TUserInfo
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table TUserInfo
-- ----------------------------
ALTER TABLE [dbo].[TUserInfo] ADD PRIMARY KEY ([UserID])
GO

-- ----------------------------
-- Indexes structure for table TUserMenu
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table TUserMenu
-- ----------------------------
ALTER TABLE [dbo].[TUserMenu] ADD PRIMARY KEY ([UserMenuID])
GO
